package chixing.day09.work;

public class AdminUser extends User implements Authenticatable{
    private String adminCode;
    private String inputAdminCode;
    public AdminUser(String userName, String userPassword, String adminCode){
        super(userName, userPassword);
        this.adminCode = adminCode;
    }

    public void setInputAdminCode(String inputAdminCode) {
        this.inputAdminCode = inputAdminCode;
    }

    @Override
    public boolean login(String username, String password) {
        // 验证用户名、密码和管理码
        return userName.equals(username) &&
                userPassword.equals(password) &&
                adminCode.equals(inputAdminCode);
    }
}
